<div class="tab-pane active" id="query-1">
    <div class="inbox-detail">
        <h3><?php echo (isset($dataByUser[0]->classes->class_titile)) ? $dataByUser[0]->classes->class_titile : $dataByUser[0]->courses->course_titile; ?></h3>
        <span><?php echo (isset($dataByUser[0]->makeQuery->is_converted) && $dataByUser[0]->makeQuery->is_converted == SkillConfig::STATUS_ACTIVE) ? 'Coverted Users' : ''; ?></span>
        <hr>
        <b>SUBJECT: </b><small><?php echo $dataByUser[0]->mail_subject; ?></small>
        <hr><div class="main-review">
            <?php
            if (!empty($dataByUser)) {
                //echo count($dataByUser);die;
                foreach ($dataByUser as $userDetail) {                   
                    $trainer = Users::getFrontEndUser($userDetail->from_users_id);
                    $trainerName = (!empty($trainer->first_name) ? $trainer->first_name : $trainer->user->username);
                    $imgsrc = (!empty($trainer->photo)) ? getRequestbaseUrl() . getuploadFolderDir() . $userDetail->from_users_id . '/profile/minithumb/' . $trainer->photo : getWorkNoshopimage(SkillConfig::skill_myinbox_image);
                    $class_course_id = (!empty($userDetail->classes_id)) ? $userDetail->classes_id : $userDetail->courses_id;
                    $classtype = (!empty($userDetail->classes_id)) ? SkillConfig::class_name : SkillConfig::course_name;
                    $replUid = ($userDetail->from_users_id == getLoginUserId()) ? $userDetail->to_user_id : $userDetail->from_users_id;
                    ?>

                    <div class="inbox-review">
                        <a href="#">
                            <img src="<?php echo $imgsrc; ?>" alt="">
                            <div class="review-info">
                                <div class="name"><span><?php echo $trainerName; ?>  | </span><?php echo date("D, d M Y", strtotime($userDetail->created_time)) ?>
                                </div>
                                <div class="title"><?php echo $userDetail->mail_message; ?></div>
                            </div>
                        </a>
                    </div><!--query-review--> 
                    <?php
                }
                ?>
            </div>
            <div class="query-reply">
                <input type="hidden" name="" id="subject_id" value="<?php echo $userDetail->mail_subject; ?>">
                <textarea placeholder="write a reply..." class="form-control book-control" id="reply-to-trainer"></textarea>
                <div  class="errorMessage" id="errorMessage_msg_adminid"></div>
            </div>
            <div class="checkbox choice">
                <?php  if ($userDetail->makeQuery->is_converted != SkillConfig::STATUS_ACTIVE && $userDetail->makeQuery->users_id!=  getLoginUserId()) { ?>
                <input type="checkbox" id="checkbox_covertuser" onclick="updateConvert(<?php echo $userDetail->make_query_id; ?>)"> 
                    <label for="checkbox_covertuser">Convert user</label><?php } ?>
                <div id="conatctTOadminloder" style="display: none;float: left;"><img src="<?php echo ThemePath(); ?>/images/myskill.gif"></img></div>  
                <input type="submit" value="submit" onclick="return replyAMailToTrainer('<?php echo $classtype; ?>',<?php echo $class_course_id; ?>,<?php echo $replUid; ?>,<?php echo getLoginUserId(); ?>,<?php echo $userDetail->make_query_id; ?>)"/>
            </div>
            <?php
        } else {
            echo 'No Conversion.';
        }
        ?>
    </div>
</div>